<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
 
  <ui:composition template="/pages/templates/commonLayoutCli.xhtml">

	
	<ui:define name="content">

	<h:form>
		
		<center>
		

			<p:panel id="panelprof" style="width:70%;align:center;valign:middle;">
			<!-- <p:messages id="msgs"  /> -->
			<h:panelGrid  columns="3" cellpadding ="5" style="width:60%;align:center;valign:middle;">
				
				<p:outputLabel value="Nome:" ></p:outputLabel>
				<p:inputText id="nomeprof" size="50" value="#{beanCadastroProfissional.nome}" required="true" >
					<f:validateLength minimum="3" />		
				</p:inputText>
				<p:message for="nomeprof" display="icon" id="msgnomeprof" />
				
				<p:outputLabel value="CPF:" ></p:outputLabel>
				<p:inputMask id="cpfprof" size="12" mask="999.999.999-99"  value="#{beanCadastroProfissional.cpf}" required="true"  >
				<f:validateLength minimum="14"  />
				</p:inputMask>
				<p:message for="cpfprof" display="icon" />

				 <p:outputLabel value="Profissão:" ></p:outputLabel>
				<p:selectOneMenu value="#{beanCadastroProfissional.codigoProfissao}">
    				<f:selectItems value="#{beanCadastroProfissional.profissoes}" var="profissao" itemLabel="#{profissao.descricao}" itemValue="#{profissao.codigo}" />
				</p:selectOneMenu>
				<p:outputLabel value="" ></p:outputLabel>
				
				<p:outputLabel value="Área Atuação:" ></p:outputLabel>
				<p:selectOneMenu id="areaatuacao" value="#{beanCadastroProfissional.codigoAreaAtuacao}">
    				<f:selectItems value="#{beanCadastroProfissional.areasAtuacao}" var="area" itemLabel="#{area.descricao}" itemValue="#{area.codigo}" />
				</p:selectOneMenu>
				<p:outputLabel value="" ></p:outputLabel>
				
				<p:outputLabel value="Rua:" ></p:outputLabel>
				<p:inputText id="ruaprof" size="50" value="#{beanCadastroProfissional.rua}" required="true">
				<f:validateLength minimum="3" />
				</p:inputText>
				<p:message for="ruaprof" display="icon" />
				
				<p:outputLabel value="Número:" ></p:outputLabel>
				<p:inputText id="numeroprof" size="5" value="#{beanCadastroProfissional.numero}" required="true">
				<f:validateLength minimum="1" />
				</p:inputText>
				<p:message for="numeroprof" display="icon" />
				
				<p:outputLabel value="Complemento:" ></p:outputLabel>
				<p:inputText id="complementoprof" size="20" value="#{beanCadastroProfissional.complemento}" ></p:inputText>
				<p:message for="complementoprof" display="icon" />
				
				<p:outputLabel value="Bairro:" ></p:outputLabel>
				<p:inputText id="bairroprof" size="20" value="#{beanCadastroProfissional.bairro}" required="true">
				<f:validateLength minimum="1" />
				</p:inputText>
				<p:message for="bairroprof" display="icon" />
				
				<p:outputLabel value="Cidade:" ></p:outputLabel>
				<p:inputText id="cidadeprof" size="20" value="#{beanCadastroProfissional.cidade}" required="true">
				<f:validateLength minimum="1" />
				</p:inputText>
				<p:message for="cidadeprof" display="icon" />
				
				<p:outputLabel value="Estado:" ></p:outputLabel>
				<p:selectOneMenu value="#{beanCadastroProfissional.estado}">
    				<f:selectItems value="#{beanCadastroProfissional.estados}" var="estado" itemLabel="#{estado.descricao}" itemValue="#{estado.descricao}"/>
				</p:selectOneMenu>
				<p:outputLabel value="" ></p:outputLabel>
				
				<p:outputLabel value="Telefone 1:" />
        		<p:inputMask id="telefone1prof" size="12" value="#{beanCadastroProfissional.telefone1}" mask="(99) 9999-9999?9" required="true"  >
        		 <f:validateLength minimum="14" maximum="15"/>
        		</p:inputMask>
				<p:message for="telefone1prof" display="icon" />
				
				<p:outputLabel value="Telefone 2:" />
        		<p:inputMask id="telefone2prof" size="12" value="#{beanCadastroProfissional.telefone2}" mask="(99) 9999-9999?9" required="true" >
        		<f:validateLength minimum="14" maximum="15" />
        		</p:inputMask>
				<p:message for="telefone2prof" display="icon" />
				
			 </h:panelGrid>		
				<p:commandButton value="Concluir" update="panelprof" action="#{beanCadastroProfissional.criaProfissional()}">
				</p:commandButton> 
			</p:panel>
		
			

		</center>
	
	</h:form>
</ui:define>

</ui:composition>

</html>